Optimal. Leaf size=177 \[ \frac{2 \left (3 a^2 B+6 a A b+b^2 B\right ) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} \text{EllipticF}\left (\frac{1}{2} (c+d x),2\right )}{3 d}+\frac{2 \left (a^2 A-2 a b B-A b^2\right ) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} E\left (\left .\frac{1}{2} (c+d x)\right |2\right )}{d}+\frac{2 b (5 a B+3 A b) \sin (c+d x) \sqrt{\sec (c+d x)}}{3 d}+\frac{2 b B \sin (c+d x) \sqrt{\sec (c+d x)} (a+b \sec (c+d x))}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.270419, antiderivative size = 177, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {4026, 4047, 3771, 2641, 4046, 2639} \[ \frac{2 \left (3 a^2 B+6 a A b+b^2 B\right ) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} F\left (\left .\frac{1}{2} (c+d x)\right |2\right )}{3 d}+\frac{2 \left (a^2 A-2 a b B-A b^2\right ) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} E\left (\left .\frac{1}{2} (c+d x)\right |2\right )}{d}+\frac{2 b (5 a B+3 A b) \sin (c+d x) \sqrt{\sec (c+d x)}}{3 d}+\frac{2 b B \sin (c+d x) \sqrt{\sec (c+d x)} (a+b \sec (c+d x))}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4026
Rule 4047
Rule 3771
Rule 2641
Rule 4046
Rule 2639
Rubi steps
\begin{align*} \int \frac{(a+b \sec (c+d x))^2 (A+B \sec (c+d x))}{\sqrt{\sec (c+d x)}} \, dx &=\frac{2 b B \sqrt{\sec (c+d x)} (a+b \sec (c+d x)) \sin (c+d x)}{3 d}+\frac{2}{3} \int \frac{\frac{1}{2} a (3 a A-b B)+\frac{1}{2} \left (6 a A b+3 a^2 B+b^2 B\right ) \sec (c+d x)+\frac{1}{2} b (3 A b+5 a B) \sec ^2(c+d x)}{\sqrt{\sec (c+d x)}} \, dx\\ &=\frac{2 b B \sqrt{\sec (c+d x)} (a+b \sec (c+d x)) \sin (c+d x)}{3 d}+\frac{2}{3} \int \frac{\frac{1}{2} a (3 a A-b B)+\frac{1}{2} b (3 A b+5 a B) \sec ^2(c+d x)}{\sqrt{\sec (c+d x)}} \, dx+\frac{1}{3} \left (6 a A b+3 a^2 B+b^2 B\right ) \int \sqrt{\sec (c+d x)} \, dx\\ &=\frac{2 b (3 A b+5 a B) \sqrt{\sec (c+d x)} \sin (c+d x)}{3 d}+\frac{2 b B \sqrt{\sec (c+d x)} (a+b \sec (c+d x)) \sin (c+d x)}{3 d}+\left (a^2 A-A b^2-2 a b B\right ) \int \frac{1}{\sqrt{\sec (c+d x)}} \, dx+\frac{1}{3} \left (\left (6 a A b+3 a^2 B+b^2 B\right ) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)}\right ) \int \frac{1}{\sqrt{\cos (c+d x)}} \, dx\\ &=\frac{2 \left (6 a A b+3 a^2 B+b^2 B\right ) \sqrt{\cos (c+d x)} F\left (\left .\frac{1}{2} (c+d x)\right |2\right ) \sqrt{\sec (c+d x)}}{3 d}+\frac{2 b (3 A b+5 a B) \sqrt{\sec (c+d x)} \sin (c+d x)}{3 d}+\frac{2 b B \sqrt{\sec (c+d x)} (a+b \sec (c+d x)) \sin (c+d x)}{3 d}+\left (\left (a^2 A-A b^2-2 a b B\right ) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)}\right ) \int \sqrt{\cos (c+d x)} \, dx\\ &=\frac{2 \left (a^2 A-A b^2-2 a b B\right ) \sqrt{\cos (c+d x)} E\left (\left .\frac{1}{2} (c+d x)\right |2\right ) \sqrt{\sec (c+d x)}}{d}+\frac{2 \left (6 a A b+3 a^2 B+b^2 B\right ) \sqrt{\cos (c+d x)} F\left (\left .\frac{1}{2} (c+d x)\right |2\right ) \sqrt{\sec (c+d x)}}{3 d}+\frac{2 b (3 A b+5 a B) \sqrt{\sec (c+d x)} \sin (c+d x)}{3 d}+\frac{2 b B \sqrt{\sec (c+d x)} (a+b \sec (c+d x)) \sin (c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 1.26277, size = 125, normalized size = 0.71 \[ \frac{2 \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} \left (\left (3 a^2 B+6 a A b+b^2 B\right ) \text{EllipticF}\left (\frac{1}{2} (c+d x),2\right )+3 \left (a^2 A-2 a b B-A b^2\right ) E\left (\left .\frac{1}{2} (c+d x)\right |2\right )+\frac{b \sin (c+d x) (3 (2 a B+A b) \cos (c+d x)+b B)}{\cos ^{\frac{3}{2}}(c+d x)}\right )}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 4.855, size = 677, normalized size = 3.8 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \sec \left (d x + c\right ) + A\right )}{\left (b \sec \left (d x + c\right ) + a\right )}^{2}}{\sqrt{\sec \left (d x + c\right )}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{B b^{2} \sec \left (d x + c\right )^{3} + A a^{2} +{\left (2 \, B a b + A b^{2}\right )} \sec \left (d x + c\right )^{2} +{\left (B a^{2} + 2 \, A a b\right )} \sec \left (d x + c\right )}{\sqrt{\sec \left (d x + c\right )}}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \sec \left (d x + c\right ) + A\right )}{\left (b \sec \left (d x + c\right ) + a\right )}^{2}}{\sqrt{\sec \left (d x + c\right )}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]